﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using MvcSystemsCommander.Models.Repository;

namespace MvcSystemsCommander.Models.Service
{
    public class GenericService<T> : IGenericService<T> where T : class
    {
        protected IRepository<T> _ServiceRepository;
        protected IUnitOfWork _ServiceUnitOfWork;

        public IRepository<T> ServiceRepository
        {
            get { return _ServiceRepository; }
        }

        public IUnitOfWork ServiceUnitOfWork
        {
            get { return _ServiceUnitOfWork; }
        }

        public GenericService()
        {
            this._ServiceUnitOfWork = new UnitOfWork();
            this._ServiceRepository = new Repository<T>(_ServiceUnitOfWork);
        }
    }
}